
    var page = 0;
    var page_num;
    var limit = 10;
    function show_word_list(page, limit) {
        $.ajax({
            type: "POST",
            url: APP + "/Blog/page",
            data: {
                "page": page,
                "limit": limit
            },
            async: true,
            dataType: "json",
            success: function (html) {
                if (html['total'] > 0) {
                    $("#index_main").empty();
                    $.each(html["data"], function (index, item) {
                        $("#index_main").append("<article id='" + item['Id'] + "' class='post tag-opensource'><div class='post-head'><h1 class='post-title'><a href='" + APP + "/Word/word_list/" + item['Id'] + "'>" + item['title'] + "</a></h1><div class='post-meta'><time class='date' datetime='" + item['datetime'] + "'>" + item['datetime'] + "</time></div></div><div class='post-content'>" + item['text'] + "</div><div class='post-permalink'><a href='" + APP + "/Word/word_list/" + item['Id'] + "' class='btn btn-primary'>阅读全文</a></div><footer class='post-footer clearfix'><div class='pull-left tag-list'><i class='glyphicon glyphicon-folder-open'></i><a href='" + APP + "/Label/label_for_word/" + item['label_id'] + "/" + item['Id'] + "'>" + item['label_name'] + "</a></div><div class='pull-right share'></div></footer></article>");
                    });
                    page_num = Math.ceil(html['total'] / limit);
                    $("#this_page").html(page + 1);
                    $("#page_num").html(page_num);
                    if (page == 0) {
                        $("#page_pre").hide();
                    }
                    else {
                        $("#page_pre").show();
                    }
                    if ((page + 1) == page_num) {
                        $("#page_next").hide();
                    }
                    else {
                        $("#page_next").show();
                    }
                }
                else {
                    $("#this_page").html(page);
                    $("#page_next").hide();
                    $("#index_main").empty();
                    $("#index_main").append("<article class='post tag-opensource'><div class='post-head'><h1 class='post-title'>数据加载完成</a></h1></div></article>");
                }
            },
            error: function () {
                $("#index_main").append("<article class='post tag-opensource'><div class='post-head'><h1 class='post-title'>网络异常</a></h1></div></article>");
            }
        });
    }

    show_word_list(page, limit);
    $("#page_pre").click(function () {
        page = page - 1;
        show_word_list(page, limit);
    });
    $("#page_next").click(function () {
        page = page + 1;
        show_word_list(page, limit);
    });
